package api.apiservice.apiopenplat.controller;

import api.apiservice.apiopenplat.common.unifyDataForm.Result;
import api.apiservice.apiopenplat.entity.ApiInfo;
import api.apiservice.apiopenplat.entity.SortInfo;
import api.apiservice.apiopenplat.service.SortInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/system/apiInfo")
public class SortInfoController {

    @Autowired
    private  SortInfoService sortInfoService;

    @GetMapping("getSortInfo")
    public Result  getSortInfo(){
        return Result.success( sortInfoService.list());
    }

    @GetMapping("getSortInfoList")
    public Result getSortInfoList(){
        HashMap<String,List<HashMap<String,List<ApiInfo>>>> sortInfo = sortInfoService.getSortInfo();
        return Result.success(sortInfo);
    }
}
